package org.openkoala.koala.popup.preference;

import org.eclipse.swt.widgets.Composite;
import org.openkoala.koala.exception.KoalaException;

public abstract class ConfigComponent {

	private String configName;
	
	private boolean hasVisited;

	private Composite composite;
	
	public boolean hasVisited() {
		return hasVisited;
	}

	public void setHasVisited(boolean hasVisited) {
		this.hasVisited = hasVisited;
	}

	public String getConfigName() {
		return configName;
	}
	
	public Composite getComposite() {
		return composite;
	}

	protected void setComposite(Composite composite) {
		this.composite = composite;
	}

	ConfigComponent(String configName) {
		if (configName == null) {
			throw new KoalaException("配置组件初始化");
		}
		
		this.configName = configName;
	}
	
	public abstract void createComposite(Composite parent);
	
	public abstract void doConfig();
	
}
